How to solve a system of equations from a word problem